Skip to content

Conversation

@dolmen
Copy link

@dolmen dolmen commented Sep 5, 2025

Modernize code to use any instead of interface{}.

The process is automated with gopls's modernizer:

$ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./... 2>&1 | sed -e "s@${PWD}/@@"
client.go:14:13: interface{} can be replaced by any
client.go:128:44: interface{} can be replaced by any
client.go:147:43: interface{} can be replaced by any
client.go:181:32: interface{} can be replaced by any
client.go:193:32: interface{} can be replaced by any
server.go:22:13: interface{} can be replaced by any
server.go:30:13: interface{} can be replaced by any
server.go:68:42: interface{} can be replaced by any
server.go:78:51: interface{} can be replaced by any
varlink.go:25:31: interface{} can be replaced by any
varlink.go:35:30: interface{} can be replaced by any
exit status 3

The fixes are then applied with -fix.

Modernize code to use `any` instead of `interface{}`.

The process is automated with gopls's modernizer.

$ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./... 2>&1 | sed -e "s@${PWD}/@@"
client.go:14:13: interface{} can be replaced by any
client.go:128:44: interface{} can be replaced by any
client.go:147:43: interface{} can be replaced by any
client.go:181:32: interface{} can be replaced by any
client.go:193:32: interface{} can be replaced by any
server.go:22:13: interface{} can be replaced by any
server.go:30:13: interface{} can be replaced by any
server.go:68:42: interface{} can be replaced by any
server.go:78:51: interface{} can be replaced by any
varlink.go:25:31: interface{} can be replaced by any
varlink.go:35:30: interface{} can be replaced by any
exit status 3

The fix is then applied with -fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant